import React from 'react';
import { Link } from 'react-router-dom';
import BackNav from 'shared/components/BackNav';
import localstorage from 'shared/utils/localStorage';
import './index.less';

const successIcon = require('src/static/successIcon.png');

export default class PaymentSuccess extends React.PureComponent {

  render() {
    const data = localstorage.getObject('payRes') || {};
    return ([
      <BackNav key='back-nav' title="收银台" />,
      (
        <div className="payment-success" key='payment-success'>
          <div className="payment-success-content">
            <img src={successIcon} alt='' />
            <div className='payment-success-content-info'>
              <span>支付成功</span>
              <span className="success-info">我们尽快为您处理</span>
              <span className="button"><Link to="/">继续逛逛&gt;&gt;</Link></span>
            </div>
          </div>

          <div className="order-number">
            <div className="order-number-container">
              <div><span>订单编号：</span><span>{data.order_id}</span></div>
              <div><span>在线支付：</span><span>{data.totalmoney}元</span></div>
            </div>
          </div>
        </div>
      )
    ])
  }
}
